﻿<UserControl
    x:Class="Spritehand.PhysicsHelper.Demos.UWP.ucTruck"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Spritehand.PhysicsHelper.Demos.UWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ph="using:Spritehand.FarseerHelper"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Canvas x:Name="LayoutRoot" >
        <ph:PhysicsSprite Height="78.667" x:Name="cnvBody" CollisionGroup="1"  Width="197" Canvas.Left="8" Canvas.Top="8" ShapeType="Polygon">

            <Path x:Name="bodyBoundary"  Fill="Red" Data="M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z" Height="75" Canvas.Left="1.5" Stretch="Fill" Stroke="#FF000000" Canvas.Top="1.5" UseLayoutRounding="False" Width="195">

            </Path>

            <Path Height="27.5" Width="42" Canvas.Left="88.667" Canvas.Top="2.169" Data="M81.167,-171.33099 L81.167,-146.33099 L122.167,-144.83099 L111.167,-170.83099 z" Stretch="Fill" Stroke="#FF000000">
                <Path.Fill>
                    <LinearGradientBrush EndPoint="0.811,0.681" StartPoint="0.189,0.319">
                        <GradientStop Color="#FFFFFFFF"/>
                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                        <GradientStop Color="#FFCFFFFF" Offset="0.49099999666213989"/>
                    </LinearGradientBrush>
                </Path.Fill>
            </Path>
            <Path Height="11.501" Width="6.379" Canvas.Left="186.045" Canvas.Top="49.155" Data="M183.16699,-124.33099 C183.16699,-124.33099 177.66699,-124.83099 178.66699,-119.83099 C179.66699,-114.83099 180.1673,-112.83116 182.66704,-114.33112 C185.16679,-115.83109 183.16699,-124.33099 183.16699,-124.33099 z" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000"/>
        </ph:PhysicsSprite>

        <ph:PhysicsSprite Height="60" x:Name="cnvWheelBack" Width="60" Canvas.Left="27" Canvas.Top="72" ShapeType="Ellipse" >
            <Ellipse Height="60" Width="60" Canvas.Left="0" Canvas.Top="0" Stroke="#FF000000">
                <Ellipse.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF000000"/>
                        <GradientStop Color="#FF4F4949" Offset="1"/>
                    </LinearGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Ellipse Fill="Black" Height="40" Width="40" Canvas.Left="10" Canvas.Top="10" Stroke="#FF000000">
            </Ellipse>
        </ph:PhysicsSprite>

        <ph:PhysicsSprite Height="60" x:Name="cnvWheelFront" Width="60" Canvas.Left="127" Canvas.Top="72" ShapeType="Ellipse">
            <Ellipse Height="60" Width="60" Canvas.Left="0" Canvas.Top="0" Stroke="#FF000000">
                <Ellipse.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF000000"/>
                        <GradientStop Color="#FF4F4949" Offset="1"/>
                    </LinearGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
            <Ellipse Fill="Black" Height="40" Width="40" Canvas.Left="10" Canvas.Top="10" Stroke="#FF000000">
            </Ellipse>
        </ph:PhysicsSprite>

        <ph:PhysicsJoint Canvas.Left="53" Canvas.Top="97" BodyOne="cnvBody" BodyTwo="cnvWheelBack" CollisionGroup="1" />

        <ph:PhysicsJoint Canvas.Left="153" Canvas.Top="97" BodyOne="cnvBody" BodyTwo="cnvWheelFront" CollisionGroup="1" />

    </Canvas>
</UserControl>
